/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ac.za.cput.kleintjes.question3.srp.obeys.model;

/**
 *
 * @author Administrator
 */
public class FibonacciNumberCorrected {
    private String message;

    public FibonacciNumberCorrected(int number) {
        printFibonacci(number);
    }
        
    public void printFibonacci(int number) {
        message = number+"! = ";
        int current = 1;
        int past = 0;
        int temp;
        
        if(number == 1)
            message += "0";
        else if(number == 2)
            message += "0, 1";
        
        for(int x=0; x<number; x++) {
            temp = current + past;
            
            message += ", "+temp;
            past = current;
            current = temp;
        }      
    }   
    
    public void printFibonacci() {
        System.out.println(message);
    }
    
    public String getFibonacci() {
        return message;
    }
        
}